package main

import (
	"graduate_student/model"
	"graduate_student/routers"
	"os"

	_ "github.com/lib/pq"

	"github.com/spf13/viper"
)

func main() {
	InitConfig()
	db := model.InitDB()
	defer db.Close()
	r := routers.InitRouter()
	//r = CollectRoute(r)
	panic(r.Run())
}

func InitConfig() {
	workDir, _ := os.Getwd()
	viper.SetConfigName("app")
	viper.SetConfigType("yml")
	viper.AddConfigPath(workDir + "/config")
	err := viper.ReadInConfig()
	if err != nil {
	}
}
